//
//  GOColor.m
//  GO
//
//  Created by Kyle Sun on 30/08/2016.
//  Copyright © 2016 INMOTION. All rights reserved.
//

#import "GOColor.h"

@implementation GOColor

+ (UIColor *)colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue {
    return [self colorWithRed:red green:green blue:blue alpha:1];
}

+ (UIColor *)colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha {
    return [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:alpha];
}

+ (UIColor *)lightBlue {
    return [self colorWithRed:1 green:236 blue:236];
}

+ (UIColor *)brownBlue {
    return [self colorWithRed:10 green:90 blue:128 alpha:0.5];
}

+ (UIColor *)darkBlue {
    return [self darkBlueWithAlpha:1];
}

+ (UIColor *)lightBlueWithAlpha:(CGFloat)alpha {
    return [self colorWithRed:1 green:236 blue:236 alpha:alpha];
}

+ (UIColor *)darkBlueWithAlpha:(CGFloat)alpha {
    return [self colorWithRed:67 green:183 blue:237 alpha:alpha];
}

+ (UIColor *)darkBlue2 {
    return [self colorWithRed:15 green:107 blue:186];
}

+ (UIColor *)separatorColor {
    return [self colorWithRed:16 green:120 blue:209 alpha:0.5];
}

+ (UIColor *)colorWithString:(NSString *)string {
    NSArray *values = [string componentsSeparatedByString:@","];
    if (values.count >= 3) {
        int r = [values[0] intValue];
        int g = [values[1] intValue];
        int b = [values[2] intValue];
        return [GOColor colorWithRed:r green:g blue:b];
    }
    return [self lightBlue];
}

+ (UIColor *)colorWithColor:(UIColor *)color alpha:(CGFloat)alpha {
    CGFloat r, g, b, a;
    [color getRed:&r green:&g blue:&b alpha:&a];
    return [UIColor colorWithRed:r green:g blue:b alpha:alpha];
}

+ (UIColor *)orange {
    return [self orangeWithAlpha:1];
}

+ (UIColor *)orangeWithAlpha:(CGFloat)alpha {
    return [self colorWithRed:244 green:183 blue:4 alpha:alpha];
}

+ (UIColor *)green {
    return [self greenWithAlpha:1];
}

+ (UIColor *)greenWithAlpha:(CGFloat)alpha {
    return [self colorWithRed:22 green:216 blue:128 alpha:alpha];
}

+ (UIColor *)darkBackground {
    return [self colorWithRed:12 green:18 blue:31];
}

+ (UIColor *)darkBackgroundWithAlpha:(CGFloat)alpha {
    return [self colorWithRed:12 green:18 blue:31 alpha:alpha];
}

+ (UIColor *)lightBackground {
    return [self colorWithRed:21 green:30 blue:49];
}

+ (UIColor *)lightTextColor {
    return [self colorWithRed:190 green:235 blue:254];
}

+ (UIColor *)red {
    return [self colorWithRed:209 green:21 blue:16];
}

+ (UIColor *)redWithAlpha:(CGFloat)alpha {
    return [self colorWithRed:209 green:21 blue:16 alpha:alpha];
}

@end
